﻿using System;
using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace HRMService
{

    [ServiceContract(Namespace = "http://HRMService")]
    public interface IEmployee
    {
        [OperationContract]
        DataSet Employee_GetByDepartment(int DeptID);

        [OperationContract]
        bool Employee_UpdateImageNull(int EmployeeID);

        [OperationContract]
        DataSet Employee_GetForReportByAge();
        [OperationContract]
        DataSet Employee_GetForForm02(int _period, int _month, int _year, int _BranchID);

        [OperationContract]
        DataSet Employee_GetLabourContract(out int ItemCount, out int Total, int day, DateTime Date, int Type, string orderBy, string orderDirection, int currentPage, int pageSize, int _BranchID, int _DepartmentID);
        [OperationContract]
        DataSet Employee_GetList2(int branchID, int departmentID, int Type);

        [OperationContract]
        int Employee_Using(int EmployeeID);

        [OperationContract]
        DataSet Employee_GetDangVien(int branchID, int DepartmentID, int _DangVien);

        [OperationContract]
        DataSet Employee_GetListNotActive(out int ItemCount, string keyWord, string orderBy, string orderDirection, int currentPage, int pageSize, int Branch_ID, int Department_ID);

        [OperationContract]
        DataSet Employee_GetAdvSearch(out int ItemCount, int _Branch_ID, string _No, string _CardNo, string _IDCardNo,
            string _FullName, DateTime _DOBFrom, DateTime _DOBTo, string _POB, string _Sex, int _Standard_ID, int _Position_ID, int _Grade_ID, int _ContractType_ID,
            string _Specialist, decimal _BasicSalaryFrom, decimal _BasicSalaryTo, string _LCNo, DateTime _LC_BeginDateFrom,
            DateTime _LC_BeginDateTo, DateTime _LC_FinishDateFrom, DateTime _LC_FinishDateTo, string _Address, string _Job, string _BookNo,
            string _MedicalNo, DateTime _StartDateFrom, DateTime _StartDateTo, string orderBy, string orderDirection, int currentPage, int pageSize);

        [OperationContract]
        DataSet Employee_GetAll();

        [OperationContract]
        int Employee_CodeExist(int EmployeeID, string Code);

        [OperationContract]
        DataSet Employee_BirthDay(out int ItemCount, int month, int branchID, int departmentID, int currentPage, int pageSize);

        [OperationContract]
        DataSet Employee_BirthDayForReport(int month, int branchID, int departmentID);

        [OperationContract]
        DataSet Employee_NghiThaiSanList(out int ItemCount,int branchID, int departmentID, int currentPage, int pageSize);

        [OperationContract]
        DataSet Employee_DanhSachVuotKhungList(out int ItemCount, int month,int year, int branchID, int departmentID, int currentPage, int pageSize);

        [OperationContract]
        DataSet Employee_DanhSachNgheList(out int ItemCount, int month, int year, int branchID, int departmentID, int currentPage, int pageSize);

        [OperationContract]
        DataSet Employee_Form02MucLuongDuyNhat(string branchCode, int year, int month, string typeCode);

        [OperationContract]
        DataSet Employee_FormEpChucDanh(string branchCode, int year);

        [OperationContract]
        DataSet Employee_Form02DieuChinhLuongTheoNhom(string branchCode, int year, int month, float amount);

        [OperationContract]
        DataSet Employee_IncreaseSalaryForReport(int month, int departmentID, DateTime ToDate);

        [OperationContract]
        DataSet Employee_SuperannuationForReport(int month, int departmentID, DateTime ToDate, int MaleAge, int FeMaleAge);

        [OperationContract]
        DataSet Employee_IncreaseSalary(out int ItemCount, int _day, int branchID, int departmentID, DateTime ToDate, int currentPage, int pageSize, int _Type);

        [OperationContract]
        DataSet Employee_Superannuation(out int ItemCount, int month, int branchID, int departmentID, DateTime ToDate, int MaleAge, int FeMaleAge, int currentPage, int pageSize);

        [OperationContract]
        DataSet Employee_GetListForReport(int Branch_ID, int Department_ID, string Employee_Sex, int Grade_ID, int From_Age, int To_Age, int _Month, int _Year, int _ToMonth, int _ToYear);

        [OperationContract]
        DataSet Employee_GetWithDepartment(int DepartmentID);

        [OperationContract]
        DataSet Employee_GetGirlWithDepartment(int DepartmentID);

        [OperationContract]
        DataSet Employee_GetAllWithBranch(int BranchID);

        [OperationContract]
        DataSet Employee_GetAllWithDepartment(int DepartmentID);

        [OperationContract]
        DataSet Employee_GetWithPageDepartment(out int ItemCount, int currentPage, int pageSize, int DepartmentID);

        [OperationContract]
        EmployeeInfo Employee_GetInfo(int EmployeeID);

        [OperationContract]
        EmployeeInfo Employee_GetInfoBySIBookNo(string _SIBookNo);

        [OperationContract]
        EmployeeInfo Employee_GetMaleAndFemale(int BranchID);

        [OperationContract]
        DataSet Employee_GetList(out int ItemCount, int branchID, int departmentID, string keyWord, string orderBy, string orderDirection, int currentPage, int pageSize);
        [OperationContract]
        DataSet Employee_GetProbationList(out int ItemCount, int branchID, int departmentID, string keyWord, string orderBy, string orderDirection, int currentPage, int pageSize);

        [OperationContract]
        DataSet Employee_GetListTMP(out int ItemCount, string keyWord, string orderBy, string orderDirection, int currentPage, int pageSize, int Branch_ID, int Department_ID);

        [OperationContract]
        int Employee_Insert(EmployeeInfo eInfo);

        [OperationContract]
        int Employee_Import(EmployeeInfo eInfo);
        

        [OperationContract]
        bool Employee_Update(EmployeeInfo eInfo);

        [OperationContract]
        int Employee_CheckExist(int EmployeeID, string EmployeeCode, int _BranchID);

        [OperationContract]
        int Employee_CheckExist2(int _BranchID, DateTime _DateOfBirth, string _EmployeeCardNo, string _EmployeeSiBookNo);

        [OperationContract]
        int Employee_CheckIDCard(int EmployeeID, string Employee_IDCardNo, int _BranchID);

        [OperationContract]
        int Employee_CheckExistSIBookNo(int EmployeeID, string SIBookNo, int _BranchID);

        [OperationContract]
        int Employee_CountTotalDateWork(DateTime _FromDate, DateTime _ToDate);

        [OperationContract]
        bool Employee_CheckNewMember(int EmployeeID, DateTime _Date);

        [OperationContract]
        int Employee_CountDateWorkNewMember(int EmployeeID, DateTime _ToDate);

        [OperationContract]
        bool Employee_Delete(int EmployeeID);

        [OperationContract]
        bool Employee_UpdateImage(int EmployeeID, byte[] _Image);

        [OperationContract]
        byte[] Employee_GetImage(int EmployeeID);

        [OperationContract]
        bool Employee_UpdateUserName(int EmployeeID, string _UserName);

        [OperationContract]
        bool Employee_UpdateEmployeeCode(int EmployeeID, string _EmployeeCode);

        [OperationContract]
        EmployeeInfo Employee_GetMaxEmployeeCode(int Branch_ID);
        [OperationContract]
        DataSet Employee_Total(int _branch, int _year);
        [OperationContract]
        DataSet Employee_TotalYears(int _branch, int _year);

        [OperationContract]
        DataSet Employee_Enumerate(int _branch);
        [OperationContract]
        DataSet Employee_Descrease(int _branch, int _month, int _year, int _tomonth, int _toyear);
        [OperationContract]
        DataSet Employee_Declaration(int _branch, int _month, int _year, int _tomonth, int _toyear);
        [OperationContract]
        DataSet Employee_Standard(int _branch, int _year);
        [OperationContract]
        DataSet EmplooyeeNotLabourContractList_Report(int _branch);
        [OperationContract]
        bool Employee_UpdateSIBookNo(string _Old, string _New);

        //
        [OperationContract]
        string Employee_SinhSoSoTam();
    }

    [DataContract(Namespace = "http://HRMService")]
    public class EmployeeInfo
    {
        int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        string _Code;
        [DataMember]
        public string Code
        {
            get { return _Code; }
            set { _Code = value; }
        }

        string _CardNo;
        [DataMember]
        public string CardNo
        {
            get { return _CardNo; }
            set { _CardNo = value; }
        }

        string _FirstName;
        [DataMember]
        public string FirstName
        {
            get { return _FirstName; }
            set { _FirstName = value; }
        }

        string _LastName;
        [DataMember]
        public string LastName
        {
            get { return _LastName; }
            set { _LastName = value; }
        }

        int _Education;
        [DataMember]
        public int Education
        {
            get { return _Education; }
            set { _Education = value; }
        }

        string _Alias;
        [DataMember]
        public string Alias
        {
            get { return _Alias; }
            set { _Alias = value; }
        }

        string _UserName;
        [DataMember]
        public string UserName
        {
            get { return _UserName; }
            set { _UserName = value; }
        }

        DateTime _DateOfBirth;
        [DataMember]
        public DateTime DateOfBirth
        {
            get { return _DateOfBirth; }
            set { _DateOfBirth = value; }
        }

        bool _Sex;
        [DataMember]
        public bool Sex
        {
            get { return _Sex; }
            set { _Sex = value; }
        }

        int _MaterialStatusID;
        [DataMember]
        public int MaterialStatusID
        {
            get { return _MaterialStatusID; }
            set { _MaterialStatusID = value; }
        }

        int _ReligionID;
        [DataMember]
        public int ReligionID
        {
            get { return _ReligionID; }
            set { _ReligionID = value; }
        }

        int _EthlicID;
        [DataMember]
        public int EthlicID
        {
            get { return _EthlicID; }
            set { _EthlicID = value; }
        }

        string _PlaceOfBirth;
        [DataMember]
        public string PlaceOfBirth
        {
            get { return _PlaceOfBirth; }
            set { _PlaceOfBirth = value; }
        }

        string _Address;
        [DataMember]
        public string Address
        {
            get { return _Address; }
            set { _Address = value; }
        }

        string _NativeCountry;
        [DataMember]
        public string NativeCountry
        {
            get { return _NativeCountry; }
            set { _NativeCountry = value; }
        }

        string _Phone;
        [DataMember]
        public string Phone
        {
            get { return _Phone; }
            set { _Phone = value; }
        }

        string _PassportNo;
        [DataMember]
        public string PassportNo
        {
            get { return _PassportNo; }
            set { _PassportNo = value; }
        }

        DateTime _PassportIssueDate;
        [DataMember]
        public DateTime PassportIssueDate
        {
            get { return _PassportIssueDate; }
            set { _PassportIssueDate = value; }
        }

        DateTime _PassportExpireDate;
        [DataMember]
        public DateTime PassportExpireDate
        {
            get { return _PassportExpireDate; }
            set { _PassportExpireDate = value; }
        }

        int _Nationality;
        [DataMember]
        public int Nationality
        {
            get { return _Nationality; }
            set { _Nationality = value; }
        }

        string _IDCardNo;
        [DataMember]
        public string IDCardNo
        {
            get { return _IDCardNo; }
            set { _IDCardNo = value; }
        }

        DateTime _IDCardIssueDate;
        [DataMember]
        public DateTime IDCardIssueDate
        {
            get { return _IDCardIssueDate; }
            set { _IDCardIssueDate = value; }
        }

        string _IDCardIssueAuthority;
        [DataMember]
        public string IDCardIssueAuthority
        {
            get { return _IDCardIssueAuthority; }
            set { _IDCardIssueAuthority = value; }
        }

        string _SIBookNo;
        [DataMember]
        public string SIBookNo
        {
            get { return _SIBookNo; }
            set { _SIBookNo = value; }
        }

        DateTime _SIBookIssueDate;
        [DataMember]
        public DateTime SIBookIssueDate
        {
            get { return _SIBookIssueDate; }
            set { _SIBookIssueDate = value; }
        }

        string _SIBookIssueAuthority;
        [DataMember]
        public string SIBookIssueAuthority
        {
            get { return _SIBookIssueAuthority; }
            set { _SIBookIssueAuthority = value; }
        }

        string _BankAccountNo;
        [DataMember]
        public string BankAccountNo
        {
            get { return _BankAccountNo; }
            set { _BankAccountNo = value; }
        }

        string _BankName;
        [DataMember]
        public string BankName
        {
            get { return _BankName; }
            set { _BankName = value; }
        }

        string _Description;
        [DataMember]
        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }

        bool isDelete;
        [DataMember]
        public bool IsDelete
        {
            get { return isDelete; }
            set { isDelete = value; }
        }

        bool isQuit;
        [DataMember]
        public bool IsQuit
        {
            get { return isQuit; }
            set { isQuit = value; }
        }

        DateTime _StartDate;
        [DataMember]
        public DateTime StartDate
        {
            get { return _StartDate; }
            set { _StartDate = value; }
        }

        DateTime _EndDate;
        [DataMember]
        public DateTime EndDate
        {
            get { return _EndDate; }
            set { _EndDate = value; }
        }

        int _EmployeeTotal;
        [DataMember]
        public int EmployeeTotal
        {
            get { return _EmployeeTotal; }
            set { _EmployeeTotal = value; }
        }
        int _EmployeeMale;
        [DataMember]
        public int EmployeeMale
        {
            get { return _EmployeeMale; }
            set { _EmployeeMale = value; }
        }
        int _EmployeeFemale;
        [DataMember]
        public int EmployeeFemale
        {
            get { return _EmployeeFemale; }
            set { _EmployeeFemale = value; }
        }
        bool _IsOfficer;
        [DataMember]
        public bool IsOfficer
        {
            get { return _IsOfficer; }
            set { _IsOfficer = value; }
        }
        string _MedicalNo;
        [DataMember]
        public string MedicalNo
        {
            get { return _MedicalNo; }
            set { _MedicalNo = value; }
        }
        DateTime _MedicalDate;
        [DataMember]
        public DateTime MedicalDate
        {
            get { return _MedicalDate; }
            set { _MedicalDate = value; }
        }
        string _MedicalPlace;
        [DataMember]
        public string MedicalPlace
        {
            get { return _MedicalPlace; }
            set { _MedicalPlace = value; }
        }

        string _MedicalRegionCode;
        [DataMember]
        public string MedicalRegionCode
        {
            get { return _MedicalRegionCode; }
            set { _MedicalRegionCode = value; }
        }

        bool _Type;
        [DataMember]
        public bool Type
        {
            get { return _Type; }
            set { _Type = value; }
        }
        int _LeaveWorkID;
        [DataMember]
        public int LeaveWorkID
        {
            get { return _LeaveWorkID; }
            set { _LeaveWorkID = value; }
        }

        bool _UnemployIns;
        [DataMember]
        public bool UnemployIns
        {
            get { return _UnemployIns; }
            set { _UnemployIns = value; }
        }

        DateTime _UnemployInsDate;
        [DataMember]
        public DateTime UnemployInsDate
        {
            get { return _UnemployInsDate; }
            set { _UnemployInsDate = value; }
        }

        string _Specialist;
        [DataMember]
        public string Specialist
        {
            get { return _Specialist; }
            set { _Specialist = value; }
        }
        string _Culture;
        [DataMember]
        public string Culture
        {
            get { return _Culture; }
            set { _Culture = value; }
        }
        bool _IsInitial;
        [DataMember]
        public bool IsInitial
        {
            get { return _IsInitial; }
            set { _IsInitial = value; }
        }
        DateTime _PartyDate;
        [DataMember]
        public DateTime PartyDate
        {
            get { return _PartyDate; }
            set { _PartyDate = value; }
        }
        DateTime _ArmyFromDate;
        [DataMember]
        public DateTime ArmyFromDate
        {
            get { return _ArmyFromDate; }
            set { _ArmyFromDate = value; }
        }
        DateTime _ArmyToDate;
        [DataMember]
        public DateTime ArmyToDate
        {
            get { return _ArmyToDate; }
            set { _ArmyToDate = value; }
        }
        string _ArmyPosition;
        [DataMember]
        public string ArmyPosition
        {
            get { return _ArmyPosition; }
            set { _ArmyPosition = value; }
        }
        int _BranchID;
        [DataMember]
        public int BranchID
        {
            get { return _BranchID; }
            set { _BranchID = value; }
        }

        bool _UnJobFactor;
        [DataMember]
        public bool UnJobFactor
        {
            get { return _UnJobFactor; }
            set { _UnJobFactor = value; }
        }

        bool _UnOverFactor;
        [DataMember]
        public bool UnOverFactor
        {
            get { return _UnOverFactor; }
            set { _UnOverFactor = value; }
        }
    }
}
